act_site = [1 2 4 7 8];
pas_site = setdiff(1:9,act_site);
con_site = 10;

for site = act_site
    for layer = 1:4
        prps_resp = [];
        prpb_resp = [];
        for cell_id = 1:length([mean_rps_resp_by_cell{site,layer,:}])/83
            prps_resp(cell_id) = mean(mean_rps_resp_by_cell{site,layer,cell_id}(16:30));
            prpb_resp(cell_id) = mean(mean_rpb_resp_by_cell{site,layer,cell_id}(16:30));
%             prps_resp{site,layer,cell_id} = mean(mean_rps_resp_by_cell{site,layer,cell_id}(16:30));
%             prpb_resp{site,layer,cell_id} = mean(mean_rpb_resp_by_cell{site,layer,cell_id}(16:30));
        end
        mm_cells{site,layer} = find(prps_resp >= 0.175);
        mm_cells_cnt{site,layer} = length(find(prps_resp >= 0.175));
        ph_cells{site,layer} = find(prpb_resp >= 0.054);
        ph_cells_cnt{site,layer} = length(find(prpb_resp >= 0.054));
    end
end
for site = pas_site
    for layer = 1:4
        prps_resp = [];
        prpb_resp = [];
        for cell_id = 1:length([mean_rps_resp_by_cell{site,layer,:}])/83
            prps_resp(cell_id) = mean(mean_rps_resp_by_cell{site,layer,cell_id}(16:30));
            prpb_resp(cell_id) = mean(mean_rpb_resp_by_cell{site,layer,cell_id}(16:30));
%             prps_resp{site,layer,cell_id} = mean(mean_rps_resp_by_cell{site,layer,cell_id}(16:30));
%             prpb_resp{site,layer,cell_id} = mean(mean_rpb_resp_by_cell{site,layer,cell_id}(16:30));
        end
        mm_cells{site,layer} = find(prps_resp >= 0.2);
        mm_cells_cnt{site,layer} = length(find(prps_resp >= 0.2));
        ph_cells{site,layer} = find(prpb_resp >= 0.132);
        ph_cells_cnt{site,layer} = length(find(prpb_resp >= 0.132));
    end
end

% prps_resp_act = sort(horzcat(prps_resp{active_sites,:,:}),'descend');
% prps_resp_pas = sort(horzcat(prps_resp{passive_sites,:,:}),'descend');
% 
% prpb_resp_act = sort(horzcat(prpb_resp{active_sites,:,:}),'descend');
% prpb_resp_pas = sort(horzcat(prpb_resp{passive_sites,:,:}),'descend');